/* 
 * 少儿英语启蒙岛 - 样式表
 * 设计风格: 模仿多邻国 (Duolingo)
 * 特点: 高饱和度颜色、圆润设计、流畅动画
 */

/* ============================================
   全局样式和CSS变量
   ============================================ */
:root {
    /* 多邻国配色方案 */
    --color-primary: #58CC02;      /* 多邻国绿 */
    --color-primary-dark: #46A302;
    --color-primary-light: #89E219;
    
    --color-secondary: #1CB0F6;    /* 蓝色 */
    --color-secondary-dark: #1899D6;
    
    --color-success: #58CC02;      /* 成功绿 */
    --color-error: #FF4B4B;        /* 错误红 */
    --color-warning: #FFC800;      /* 警告黄 */
    
    --color-text-primary: #3C3C3C;
    --color-text-secondary: #777777;
    --color-text-light: #AFAFAF;
    
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F7F7F7;
    --color-bg-card: #FFFFFF;
    
    --color-border: #E5E5E5;
    --color-shadow: rgba(0, 0, 0, 0.1);
    
    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* ============================================
   基础重置
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(180deg, #E8F5E9 0%, #FFFFFF 100%);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   加载屏幕
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    animation: bounce 1s infinite;
}

.loading-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 16px;
    opacity: 0.9;
}

/* ============================================
   主应用容器
   ============================================ */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity var(--transition-normal);
}

.app.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   顶部导航栏
   ============================================ */
.header {
    background: white;
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 24px;
    padding: var(--spacing-xs);
    transition: transform var(--transition-fast);
}

.btn-back:active {
    transform: scale(0.9);
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    flex: 1;
    text-align: center;
}

.header-stats {
    display: flex;
    gap: var(--spacing-md);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 600;
}

.stat-icon {
    font-size: 20px;
}

/* ============================================
   屏幕容器
   ============================================ */
.screen {
    flex: 1;
    padding: var(--spacing-lg);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.screen.hidden {
    display: none;
}

/* ============================================
   模式选择对话框
   ============================================ */
.mode-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn var(--transition-normal);
}

.mode-selection-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: zoomIn var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.mode-selection-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.mode-selection-subtitle {
    font-size: 16px;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.mode-selection-buttons {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.mode-btn {
    flex: 1;
    background: white;
    border: 3px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.mode-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.mode-btn:active {
    transform: translateY(-2px);
}

.mode-btn-learn:hover {
    border-color: var(--color-secondary);
    background: linear-gradient(135deg, rgba(28, 176, 246, 0.1), rgba(28, 176, 246, 0.05));
}

.mode-btn-quiz:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(88, 204, 2, 0.1), rgba(88, 204, 2, 0.05));
}

.mode-btn-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.mode-btn-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.mode-btn-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.mode-btn-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.mode-btn-close:hover {
    background: var(--color-border);
    transform: rotate(90deg);
}

/* ============================================
   大类选择界面
   ============================================ */
.screen-categories {
    max-width: 1200px;
    margin: 0 auto;
}

.categories-container {
    padding-bottom: var(--spacing-xl);
}

.categories-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.categories-welcome {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.categories-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

/* 大类卡片 */
.category-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.category-card:active {
    transform: translateY(-4px) scale(1.01);
}

.category-icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: var(--spacing-md);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.category-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.category-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.category-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: center;
}

.category-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
}

.category-progress {
    font-size: 14px;
    color: var(--color-success);
    font-weight: 500;
}

/* ============================================
   学习岛屿地图界面（小分类）
   ============================================ */
.screen-island {
    max-width: 1200px;
    margin: 0 auto;
}

.island-container {
    padding-bottom: var(--spacing-xl);
}

.island-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-md);
}

.btn-back-to-categories {
    align-self: flex-start;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-back-to-categories:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateX(-4px);
}

.btn-back-to-categories:active {
    transform: translateX(-2px);
}

.back-icon {
    font-size: 18px;
}

.island-welcome {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.island-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

/* 课程卡片 */
.lesson-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.lesson-card:active {
    transform: translateY(-2px);
}

.lesson-card.completed {
    border: 2px solid var(--color-success);
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.lesson-icon {
    font-size: 48px;
    line-height: 1;
}

.lesson-info {
    flex: 1;
}

.lesson-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.lesson-count {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.lesson-status {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    font-size: 24px;
}

/* ============================================
   学习模式界面
   ============================================ */
.screen-learn {
    max-width: 800px;
    margin: 0 auto;
}

.learn-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 模式切换导航 */
.mode-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
}

.btn-back-nav {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 3px 10px rgba(88, 101, 242, 0.3);
    flex-shrink: 0;
}

.btn-back-nav .icon {
    font-size: 20px;
}

.btn-back-nav:hover {
    transform: translateX(-4px) scale(1.05);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.4);
}

.btn-back-nav:active {
    transform: translateX(-2px) scale(0.98);
}

.mode-tabs {
    display: flex;
    gap: var(--spacing-sm);
    background: white;
    padding: 4px;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 100px;
    justify-content: center;
}

.mode-tab .tab-icon {
    font-size: 20px;
}

.mode-tab:hover {
    background: rgba(88, 101, 242, 0.05);
    color: var(--color-primary);
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.lesson-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    text-align: right;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-toggle-language {
    background: white;
    border: 2px solid var(--color-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.btn-toggle-language .icon {
    font-size: 22px;
    transition: all var(--transition-fast);
}

.btn-toggle-language:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.btn-toggle-language:active {
    transform: scale(0.95);
}

.btn-toggle-language.hide-language {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    border-color: #9e9e9e;
}

.btn-toggle-language.hide-language .icon::after {
    content: '🚫';
    position: absolute;
    font-size: 14px;
    right: -4px;
    bottom: -4px;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #9e9e9e;
}

/* 进度条 */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    flex: 1;
    height: 16px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 50px;
    text-align: right;
}

/* 单词卡片容器 */
.card-container {
    perspective: 1000px;
    position: relative;
    touch-action: pan-y; /* 允许垂直滚动，但处理水平滑动 */
    flex: 0 1 auto;
    max-width: 500px;
    width: 100%;
}

.word-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
    text-align: center;
    animation: slideInUp var(--transition-normal);
    touch-action: none; /* 卡片上禁用默认触摸行为 */
    cursor: grab;
    user-select: none;
    position: relative;
}

.word-card:active {
    cursor: grabbing;
}

.card-image-wrapper {
    width: 100%;
    max-width: 350px;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.card-image-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image-wrapper:active {
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: transform var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
}

.card-content {
    margin-bottom: var(--spacing-lg);
}

.word-en-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.card-word-en {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    text-transform: capitalize;
}

.card-word-cn {
    font-size: 24px;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

/* 隐藏母语样式 */
body.hide-native-language .card-word-cn,
body.hide-native-language .option-text {
    display: none;
}

/* 音频按钮 - 缩小版，和英文单词同行 */
.btn-play-audio {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
    color: white;
    font-size: 24px;
    font-weight: 700;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 12px rgba(28, 176, 246, 0.4);
    border: 2px solid white;
    min-width: 50px;
    min-height: 50px;
    flex-shrink: 0;
}

.btn-play-audio:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(28, 176, 246, 0.6);
}

.btn-play-audio:active {
    transform: scale(0.95);
}

.btn-play-audio .icon {
    font-size: 28px;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

/* 卡片与控制按钮的容器 - 左右布局 */
.card-with-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: 0;
    width: 100%;
}

/* 导航按钮 - 圆形大按钮 */
.btn-nav {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
    border: none;
    cursor: pointer;
}

.btn-prev {
    background: linear-gradient(135deg, #9CA3AF, #6B7280);
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.3);
}

.btn-prev:hover {
    transform: scale(1.1) translateX(-4px);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.4);
}

.btn-prev:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-next {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.3);
}

.btn-next:hover {
    transform: scale(1.1) translateX(4px);
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.4);
}

.btn-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-nav .icon-large {
    font-size: 36px;
}

.btn-nav:active {
    transform: scale(0.95);
}

/* 学习完成提示 */
.learn-complete {
    text-align: center;
    padding: var(--spacing-xl);
    animation: zoomIn var(--transition-slow);
}

.complete-animation {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    animation: bounce 1s infinite;
}

.complete-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.complete-text {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   测试模式界面
   ============================================ */
.screen-learn,
.screen-quiz {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.learn-container,
.quiz-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}

/* 测试顶部栏 */
.quiz-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.lives-container {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    flex-shrink: 0;
}

.heart {
    font-size: 24px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(100%);
}

.heart.lost {
    animation: heartBreak var(--transition-normal);
}

/* 音频提示区 */
.quiz-audio-section {
    text-align: center;
    padding: var(--spacing-xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.quiz-audio-section {
    margin-bottom: var(--spacing-sm);
}

.quiz-word-display {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    text-transform: capitalize;
    letter-spacing: 1px;
}

.quiz-instruction {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
}

/* 测试选项网格 */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    max-width: 550px;
    margin: 0 auto;
}

.quiz-option {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xs);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.quiz-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quiz-option:active {
    transform: scale(0.98);
}

.quiz-option.selected {
    border: 3px solid var(--color-primary);
}

.quiz-option.correct {
    border: 3px solid var(--color-success);
    animation: correctShake var(--transition-normal);
}

.quiz-option.wrong {
    border: 3px solid var(--color-error);
    animation: shake var(--transition-normal);
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.option-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.option-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.option-result-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.quiz-option.correct .option-result-icon,
.quiz-option.wrong .option-result-icon {
    opacity: 1;
}

/* 反馈区域 */
.quiz-feedback {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    z-index: 200;
}

.quiz-feedback.show {
    transform: translateY(0);
}

.quiz-feedback.correct {
    background: var(--color-success);
}

.quiz-feedback.wrong {
    background: var(--color-error);
}

.feedback-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.feedback-icon {
    font-size: 32px;
}

/* 测试结果界面 */
.quiz-result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn var(--transition-normal);
}

.quiz-result > div {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: zoomIn var(--transition-normal);
}

.result-animation {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    animation: bounce 1s infinite;
}

.result-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xl);
}

.result-score {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
}

.score-label {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.score-correct {
    color: var(--color-success);
}

.score-wrong {
    color: var(--color-error);
}

.result-accuracy {
    text-align: center;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(88, 204, 2, 0.1), rgba(88, 204, 2, 0.05));
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.accuracy-label {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.accuracy-value {
    font-size: 56px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.accuracy-stars {
    font-size: 36px;
}

.result-buttons {
    display: flex;
    gap: var(--spacing-md);
}

/* ============================================
   通用按钮样式
   ============================================ */
.btn-primary {
    background: var(--color-primary);
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: transform var(--transition-fast), background var(--transition-fast);
    box-shadow: 0 4px 0 var(--color-primary-dark);
    border-bottom: 4px solid var(--color-primary-dark);
    flex: 1;
}

.btn-primary:hover {
    background: var(--color-primary-light);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: 18px;
    font-weight: 700;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: transform var(--transition-fast), background var(--transition-fast);
    border: 2px solid var(--color-border);
    flex: 1;
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-secondary:active {
    transform: translateY(2px);
}

/* ============================================
   动画关键帧
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes correctShake {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    75% { transform: scale(0.95); }
}

@keyframes heartBreak {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(-10deg); }
    100% { transform: scale(0.8) rotate(0deg); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
    
    .mode-nav {
        flex-wrap: wrap;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .btn-back-nav {
        width: 40px;
        height: 40px;
    }
    
    .btn-back-nav .icon {
        font-size: 20px;
    }
    
    .mode-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-sm);
    }
    
    .mode-tab {
        min-width: 120px;
        font-size: 14px;
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .mode-tab .tab-icon {
        font-size: 18px;
    }
    
    .lesson-name {
        flex: 1;
        font-size: 16px;
        text-align: center;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .category-card {
        padding: var(--spacing-lg);
    }
    
    .category-icon {
        font-size: 48px;
    }
    
    .island-header {
        align-items: flex-start;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    /* 学习模式移动端优化 */
    .word-en-row {
        gap: var(--spacing-sm);
    }
    
    .card-word-en {
        font-size: 36px;
    }
    
    .card-word-cn {
        font-size: 20px;
    }
    
    .btn-play-audio {
        min-width: 45px;
        min-height: 45px;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .btn-play-audio .icon {
        font-size: 24px;
    }
    
    .card-with-controls {
        gap: var(--spacing-md);
    }
    
    .card-container {
        max-width: 100%;
    }
    
    .btn-nav {
        width: 60px;
        height: 60px;
    }
    
    .btn-nav .icon-large {
        font-size: 36px;
    }
    
    .quiz-options {
        gap: var(--spacing-md);
    }
    
    .island-welcome {
        font-size: 24px;
    }
    
    .quiz-word-display {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: var(--spacing-md);
    }
    
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .header-title {
        font-size: 16px;
    }
}

/* ============================================
   iPad 专用优化
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .lessons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quiz-options {
        gap: var(--spacing-xl);
    }
}

/* ============================================
   触摸设备优化
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .lesson-card:hover {
        transform: none;
    }
    
    .quiz-option:hover {
        transform: none;
    }
    
    .btn-speaker:hover {
        transform: none;
    }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .header,
    .learn-controls,
    .quiz-audio-section {
        display: none;
    }
}

